home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6972 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  54 lines

  1. Path: wariat.org!news
  2. From: balif@nacs.net (balif)
  3. Newsgroups: comp.lang.c
  4. Subject: Array pointing to Dynamic list thingie
  5. Date: 16 Feb 1996 20:44:00 GMT
  6. Organization: -[Kender Maulers]-
  7. Message-ID: <4g2qag$pmb@wariat.wariat.org>
  8. NNTP-Posting-Host: dyn-30.nacs.net
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11. X-Newsreader: WinVN 0.99.7
  12.  
  13. The code i'm workin with is in unix/linux CC
  14.  
  15. I am trying to write a routine for a mud. What I need is an array that has X 
  16. number of trainer mobiles in the mud. so for instance,
  17. trainer_mob[3]  would reference number 3.  Then I want to have that point to 
  18. a list of numbers that represent the skills taught. So for instance
  19. for (i=1;i<10;++i)
  20.  printf("Skill: %d/n",trainer_mob[3][i]);
  21. would print out a list of skills that trainer mob 3 has. But I do not know 
  22. how long that list will be. I want something where I can say like
  23. struct trainer_mob
  24. {
  25.  int skills_taught[10];
  26. } mob_teaches { 
  27.   {
  28.     150, 153, 154,
  29.   },
  30.   {
  31.     34, 53, 100, 154,
  32.   },
  33.   {
  34.     53, 130, 
  35.   }
  36.  }
  37.  
  38. or something along that lines. I refer to circlemud3.0 "Fight.C" when it 
  39. defines the attack types. I want to be able to enter as many values as I 
  40. want then later be able to scan through them to see if the trainer teaches 
  41. the skill requested and branch to either train the person or give a message 
  42. saying "No dice."   how would i go about doing this? thanks in advance
  43.  
  44.  
  45. -- 
  46. ---Balif
  47. .--------------------------------------------------------.
  48. |When You Think You've Tried Every Road ... Every Avenue;|
  49. |Take One more Look, in what you've found Old;           |
  50. |And in it You'll find something New  --Depeche Mode     |
  51. \_Balif@nacs.net___http://www.nacs.net/~balif____________/
  52.  
  53.  
  54.